﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class FrmDel : Form
    {
        public FrmDel()
        {
            InitializeComponent();
        }


        public Form1 FrmParent { get; set; }
        private void FrmEddit_Load(object sender, EventArgs e)
        {

        }
        private void BtnEddit_Click(object sender, EventArgs e)
        {
            SE pr = new SE();
            bool flag=false;
            pr.ID = txtWorkNO.Text;
            int count = FrmParent.programmerList.Count;
            for (int i = count - 1; i >= 0;i-- )
            {
                if (FrmParent.programmerList[i].ID == pr.ID)
                {
                    flag = true;
                    FrmParent.programmerList.Remove(FrmParent.programmerList[i]);
                    MessageBox.Show("已成功删除信息");
                    
                }
            }
            if (flag == false)
            {
                MessageBox.Show("未找到所要删除的工号");
            }
            this.Close();
            this.FrmParent.BindGrid(FrmParent.programmerList);
        }

       
    }
}
